import { createcommentData, userComments } from "@/type/comment";
import request from "@/utils/request";

/** 
 * 用户查询评论列表
 * GET /comments
 */
export const usergetComments=(data:userComments)=>{
    return request({
        url:'/comments',
        method:'get',
        params:data
    })
}

/** 
 * 用户创建评论
 * POST /comments
 */
export const usercreateComments=(data:createcommentData)=>{
    return request({
        url:'/comments',
        method:'post',
        data
    })
}

/**
 * 用户删除评论
 * DELETE /comments/:id
 */
export const userdeleteComments=(id:number)=>{
    return request({
        url:`/comments/${id}`,
        method:'delete'
    })
}